home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / bbs / fido10as.zip / FIDOADDR.H < prev    next >
C/C++ Source or Header  |  1997-04-08  |  3KB  |  117 lines

  1. /*
  2.  * FidoNet(tm) Address Parsing Class (full support for 5D format)
  3.  *
  4.  * Copyright (c) 1995, 1997 by Branislav L. Slantchev
  5.  * A fine product of Silicon Creations, Inc. (gargoyle)
  6.  *
  7.  * This library is free software; you can redistribute it and/or
  8.  * modify it under the terms of the License which accompanies this
  9.  * software. This library is distributed in the hope that it will
  10.  * be useful, but without any warranty; without even the implied
  11.  * warranty of merchantability or fitness for a particular purpose.
  12.  *
  13.  * You should have received a copy of the License along with this
  14.  * library, in the file LICENSE.DOC; if not, write to the address
  15.  * below to receive a copy via electronic mail.
  16.  *
  17.  * You can reach Branislav L. Slantchev (Silicon Creations, Inc.)
  18.  * at bslantch@cs.angelo.edu. The file SUPPORT.DOC has the current
  19.  * telephone numbers and the postal address for contacts.
  20. */
  21.  
  22. #ifndef INCLUDED_FIDOADDR_H
  23. #define INCLUDED_FIDOADDR_H
  24.  
  25. class fido_address
  26. {
  27. private:
  28.     int  m_zone;
  29.     int  m_net;
  30.     int  m_node;
  31.     int  m_point;
  32.     char m_domain[255];
  33.  
  34. public:
  35.     // CONSTRUCTORS
  36.     fido_address();
  37.     fido_address(int zone, int node, int net, int point);
  38.     fido_address(int zone, int node, int net, int point, const char *domain);
  39.     fido_address(const fido_address &addr);
  40.     fido_address(const char *ascii_address);
  41.  
  42.     // MANIPULATORS
  43.     void  set_zone(int zone);
  44.     void  set_net(int net);
  45.     void  set_node(int node);
  46.     void  set_point(int point);
  47.     void  set_domain(const char *domain);
  48.  
  49.     void  split(const char *address);
  50.  
  51.     fido_address& operator=(const fido_address& addr);
  52.  
  53.     // ACCESSORS
  54.     int   zone() const;
  55.     int   net() const;
  56.     int   node() const;
  57.     int   point() const;
  58.     char* domain(char *buf) const;
  59.  
  60.     char* merge(char *buf) const;
  61.     char* merge2d(char *buf) const;
  62.     char* merge3d(char *buf) const;
  63.     char* merge4d(char *buf) const;
  64.     char* merge5d(char *buf) const;
  65. };
  66.  
  67. // inline access functions
  68. inline int
  69. fido_address::zone() const
  70. {
  71.     return m_zone;
  72. }
  73.  
  74. inline int
  75. fido_address::net() const
  76. {
  77.     return m_net;
  78. }
  79.  
  80. inline int
  81. fido_address::node() const
  82. {
  83.     return m_node;
  84. }
  85.  
  86. inline int
  87. fido_address::point() const
  88. {
  89.     return m_point;
  90. }
  91.  
  92. inline void
  93. fido_address::set_zone(int zone)
  94. {
  95.     m_zone = zone;
  96. }
  97.  
  98. inline void
  99. fido_address::set_net(int net)
  100. {
  101.     m_net = net;
  102. }
  103.  
  104. inline void
  105. fido_address::set_node(int node)
  106. {
  107.     m_node = node;
  108. }
  109.  
  110. inline void
  111. fido_address::set_point(int point)
  112. {
  113.     m_point = point;
  114. }
  115.  
  116. #endif /* INCLUDED_FIDOADDR_H */
  117.